/**
 * Email ：huangyijia138@qq.com
 * Des：
 *
 * @description: 密码登录
 * @author: huangjiajia
 * @create: 2025-01-17 09:21
 **/import java.util.*;
public class HomeWork01171 {
    public static void main(String[] args) {
        login();
    }
    public static boolean check(String username,String password) {

        return username.equals("admin") && password.equals("abc123");
    }

    public static void login() {
        java. util.Scanner scanner = new java. util. Scanner(System.in);
        while (true) {
            System.out.print("用户名；");
            String username = scanner.next();
            System.out.print("密码；；");
            String password = scanner.next();
            boolean isOk = check(username, password);
            if (isOk) {
                System.out.println("登录成功");
                return;
            } else {
                System.out.println("登录失败");
            }
        }


        }
    }


